# -------------------------------------------------------------------
#       -*- coding: utf-8 -*-
#   @Project    :   studentSystem
#   @File       :   main.py
#   @Author     :   WANGYU
#   @Time       :   2021-08-15 10:17:43
#   @Software   :   PyCharm
#   @Desc       :   
# -------------------------------------------------------------------
from util import *


def main():
    while True:
        menu()
        choose = int(input('please choose:'))  # 转换为整数!!!
        if choose in [1, 2, 3, 4, 5, 6, 7, 0]:
            if choose == 0:
                answer = input('是否退出？（y/n）')
                if answer == 'y':
                    print('已退出，谢谢使用！')
                    break  # 退出系统
                else:
                    continue  # 继续运行
            elif choose == 1:
                insert()
            elif choose == 2:
                delete()
            elif choose == 3:
                modify()
            elif choose == 4:
                search()
            elif choose == 5:
                sort()
            elif choose == 6:
                total()
            elif choose == 7:
                show()
        else:
            print('错误，输入整数！')


if __name__ == '__main__':
    main()
